<template>
  <div class="search-container" :class="{ 'search-container-dark': isDark }">
    <i class="iconfont icon-sousuo" />
    <span>搜索</span>
    <div class="search-placeholder">Ctrl <span>K</span></div>
  </div>
</template>

<script setup lang="ts">
import { useDark } from '@vueuse/core';

const isDark = useDark();
// TODO: 搜索框的搜索功能
</script>

<style scoped lang="scss">
.search-container {
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  border-radius: 16px;
  background-color: #f5f7fa;
  color: #71717a;

  i {
    font-size: 12px;
  }
  .search-placeholder {
    padding: 4px 6px;
    background-color: #fff;
    border-radius: 0 16px 16px 0;

    span {
      font-size: 10px;
    }
  }
}

.search-container-dark {
  color: #a1a1aa;
  background-color: #2e3033;

  .search-placeholder {
    background-color: #1c1e23;
  }
}
</style>
